package com.demo.thymeleafdemo.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ddone
 * @date 2024/3/12-22:40
 */
@WebServlet("/scopeB")
public class ScopeBServlet extends ViewBaseServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String requestMsg = (String) req.getAttribute("requestMsg");
        String sessionMsg = (String) req.getSession().getAttribute("sessionMsg");
        String contextMsg = (String) req.getServletContext().getAttribute("contextMsg");
        System.out.println("requestMsg = " + requestMsg);
        System.out.println("sessionMsg = " + sessionMsg);
        System.out.println("contextMsg = " + contextMsg);

    }
}
